Skip to main content

API Overview

After an asset is stored, it can be fetched. Konifer offers powerful options to fetch your asset in a variety of ways using query selectors.

Ordering

Ordering is specified using the order query selector.

OrderDescriptionDefault if not supplied
newOrder by last-created (stack semantics)Yes
modifiedOrder by last-modified

Content Negotiation

Content format is specified in two ways, resolved in this order:

  1. The format query parameter
  2. The Accept header

Accept header is ignored completely if format is used. If no format is specified, Konifer selects the return format using Accept header values. Prioritization is respected. Learn more about the Accept header here. If Accept: image/* is used, the original variant's format is returned.

If no format is acceptable using either methods, a 400 Bad Request is returned.

Fetches an absolute link to the asset as well as any LQIP and alt fields. If no return format selector is supplied, link is the default.

Request

GET /assets/users/123/profile-picture/-/link

or

GET /assets/users/123/profile-picture

Response

HTTP/1.1 200
Content-Type: application/json
K-Cache-Status: "hit" or "miss" depending on whether variant was generated or fetched

{
"url": "https://mydomain.com/assets/users/123/profile-picture/-/entry/0/content",
"lqip": {
"blurhash": "BASE64",
"thumbhash": "BASE64"
},
"alt": "Your alt"
}
Field NameTypeDescription
urlStringThe absolute URL (using /entry) to the content API
lqipLQIPLow-Quality Image Placeholder (LQIP) values if enabled in path configuration
altStringThe alt supplied when storing the asset

Fetching Redirect (/redirect)

Request

GET /assets/users/123/profile-picture/-/redirect

Response

Returns a Temporary Redirect 307:

HTTP/1.1 307
Location: https://assets.mycdn.com/d905170f-defd-47e4-b606-d01993ba7b42

If redirection strategy is none (default), then no redirect is returned:

HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 45123
Etag: 123456
K-Alt: "Your defined alt, if any"
K-Cache-Status: "hit" or "miss" depending on whether variant was generated or fetched
K-LQIP-Blurhash: "BASE64 Blurhash, if enabled"
K-LQIP-Thumbhash: "BASE64 Thumbhash, if enabled"

<image bytes>

Fetching Metadata

Request

GET /assets/users/123/profile-picture/-/metadata

Limit

Metadata is the only return format where multiple assets can be returned. Specify limit using the limit query parameter.

  • Default: 1
  • Fetch all at path: -1

Variant Generation

Transformation parameters cannot be supplied (i.e. h, r, blur, etc.) when requesting asset metadata. A 400 is returned if any transformation parameters are supplied.

Response

HTTP/1.1 200
Content-Type: application/json
K-Cache-Status: "hit" or "miss" depending on whether variant was generated or fetched

{
"class": "image",
"alt": "The alt text for an image",
"entryId": 1049,
"labels": {
"label-key": "label-value",
"phone": "Android"
},
"tags": [ "cold", "verified" ],
"source": "url",
"sourceUrl": "https://yoururl.com/image.jpeg",
"variants": [
{
"isOriginalVariant": true,
"storeBucket": "assets",
"storeKey": "d905170f-defd-47e4-b606-d01993ba7b42",
"imageAttributes": {
"height": 100,
"width": 200,
"mimeType": "image/jpeg"
},
"lqip": {
"blurhash": "BASE64",
"thumbhash": "BASE64"
}
},
{
"isOriginalVariant": false,
"storeBucket": "assets",
"storeKey": "64fffa7e-85d2-42db-a081-354c91ec7ef9.webp",
"attributes": {
"height": 2560,
"width": 1752,
"format": "webp",
"pageCount": 1,
"loop": 0
},
"transformation": {
"width": 2560,
"height": 1752,
"fit": "fit",
"gravity": "center",
"format": "webp",
"rotate": "ninety",
"flip": "none",
"filter": "none",
"blur": 0,
"quality": 80,
"padding": {
"amount": 0,
"color": []
}
},
"lqip": {}
}
],
"createdAt": "2025-11-12T01:20:55"
}
Field NameTypeDescription
classStringThe type of the asset, currently always image
altStringThe supplied alt text of your asset
entryIdLongSystem-generated unique identifier of asset within path
labelsObjectSupplied key-value pairs associated with the asset
tagsArraySupplied attributes associated with the asset
sourceStringEither url or upload depending on how you provided asset content
sourceUrlStringIf URL source was used, then this is the supplied URL
variantsAssetVariantWill only contain the original variant - the one supplied
createdAtISO 8601Date asset was stored
modifiedAtISO 8601Date asset was last modified (ignores variant generation)

AssetVariant

Field NameTypeDescription
isOriginalVariantBooleanWhether the variant is the original variant. Only one is true
storeBucketStringThe S3 bucket the asset is stored in - defined in path configuration
storeKeyStringThe key of the asset in the object store
attributesAttributesExtracted attributes of the asset
transformationTransformationNormalized original variant transformation - not returned for original variants
lqipLQIPLow-Quality Image Placeholder (LQIP) values if enabled in path configuration
Attributes
Field NameTypeDescription
heightIntegerHeight of variant
widthIntegerWidth of variant
formatFormatFormat of variant
pageCountIntegerNumber of pages in image (0 unless image is animated)
loopIntegerFor mulit-paged images, specifies the amount of animated repitions. Defaults to 0, -1 is continuous looping
Transformation

Refer to the Image Transformation Reference for greater detail about available image transformations.

Field NameTypeDescriptionAllowed Values
heightIntegerHeight of variant in pixels> 0
widthIntegerWidth of variant in pixels> 0
fitAttributesFitfit, fill, stretch
gravityGravityGravitycenter, entropy, attention
formatFormatFormat of variantSee Format
rotateRotateRotationzero, ninety, one_hundred_eight, two_hundred_seventy, auto
flipFlipWhether variat is flipped and across which axisnone, h, v
filterFilterFilternone, black_white, greyscale, sepia
blurIntegerBlur0-150
qualityIntegerCompression quality (will be 100 for PNG)1-100
paddingPaddingPadding
Padding
Field NameTypeDescriptionAllowed Values
amountIntegerAmount of padding in pixels>= 0
colorInteger[]Color pf padding in [R, G, B, A] integers

Fetching Content

Request

GET /assets/users/123/profile-picture/-/content

Response

HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 45123
Etag: 123456
K-Alt: "Your defined alt, if any"
K-Cache-Status: "hit" or "miss" depending on whether variant was generated or fetched
K-LQIP-Blurhash: "BASE64 Blurhash, if enabled"
K-LQIP-Thumbhash: "BASE64 Thumbhash, if enabled"

<image bytes>
note

Etag is only returned for this and the Download return format

Fetching Content Download

Same behavior as Content but with the addition of a Content-Disposition: attachment response header

Request

GET /assets/users/123/profile-picture/-/download

Response

HTTP/1.1 200 OK
Content-Type: image/jpeg
Content-Length: 45123
Etag: 123456
K-Alt: "Your defined alt, if any"
K-Cache-Status: "hit" or "miss" depending on whether variant was generated or fetched
K-LQIP-Blurhash: "BASE64 Blurhash, if enabled"
K-LQIP-Thumbhash: "BASE64 Thumbhash, if enabled"
Content-Disposition: attachment; filename="profile-picture.jpeg"